import os.path

import pandas as pd


class DataOperation:
    def __init__(self, path):
        self.data = pd.read_csv(path)

    def get_data_to_list(self):
        return self.data.values.tolist()

    def get_data_to_dict(self):
        return [self.data.loc[i].to_dict() for i in self.data.index.values]


if __name__ == '__main__':
    print(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
    path = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'data/lj_data.csv')
    print(path)
    do = DataOperation(path)
    # print(do.get_data_to_dict())
    print(do.get_data_to_list())
